<div class="modal fade" id="modal-create">
    <div class="modal-dialog">
        <div class="modal-content">
            <form id="create-form" method="POST" class="form-horizontal">
                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">×</span>
                    </button>
                    <h4 class="modal-title">添加角色</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            标识
                        </label>
                        <div class="col-sm-8">
                            <input type="text" name="name" value="" class="form-control">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            显示名称
                        </label>
                        <div class="col-sm-8">
                            <input type="text" name="display_name" value="" class="form-control">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            描述
                        </label>
                        <div class="col-sm-8">
                            <textarea name="description" class="form-control" rows="3" placeholder=""></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">
                        取消
                    </button>
                    <button type="submit" class="btn btn-primary">
                        确认
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-delete">
    <div class="modal-dialog">
        <div class="modal-content">
            <form id="delete-form" method="POST" class="form-horizontal">
                <input type="hidden" name="id" value="">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">×</span>
                    </button>
                    <h4 class="modal-title">操作确认</h4>
                </div>
                <div class="modal-body">
                    <p class="lead">
                        <i class="fa fa-question-circle fa-lg"></i>
                            您确认要删除
                            <kbd><span id="delete-notice-data">data</span></kbd>
                            吗？
                     </p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">
                        取消
                    </button>
                    <button type="submit" class="btn btn-primary">
                        确认
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-edit">
    <div class="modal-dialog">
        <div class="modal-content">
            <form id="edit-form" method="POST" class="form-horizontal">
                <input type="hidden" name="_method" value="PUT">
                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                <input type="hidden" name="id" value="">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">×</span>
                    </button>
                    <h4 class="modal-title">编辑角色</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            标识
                        </label>
                        <div class="col-sm-8">
                            <input type="text" name="name" value="" class="form-control">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            显示名称
                        </label>
                        <div class="col-sm-8">
                            <input type="text" name="display_name" value="" class="form-control">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            描述
                        </label>
                        <div class="col-sm-8">
                            <textarea name="description" class="form-control" rows="3" placeholder=""></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">
                        取消
                    </button>
                    <button type="submit" class="btn btn-primary">
                        确认
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-permission">
    <div class="modal-dialog">
        <div class="modal-content">
            <form id="delete-form" method="POST" class="form-horizontal">
                <input type="hidden" name="id" value="">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">×</span>
                    </button>
                    <h4 class="modal-title">权限设置</h4>
                </div>
                <div class="modal-body">
                    <div class="list-group">
                    @inject('permissionRepository', 'App\Repositories\PermissionRepository')
                    @foreach ($permissionRepository->permissions() as $group)
                        <a href="#" class="list-group-item">
                            <h4 class="list-group-item-heading">
                                <input type="checkbox" name="permissions[]" value="{{ $group->id }}">
                                {{ $group->display_name }}
                            </h4>
                            <ul class="list-inline"  style=" padding: 5px 25px;">
                                @foreach ($group->son as $item)
                                <li style=" width: 30%; padding: 5px 0;">
                                    <input type="checkbox" name="permissions[]" value="{{ $item->id }}">
                                    {{ $item->display_name }}
                                </li>
                                @endforeach
                            </ul>
                        </a>
                    @endforeach
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">
                        取消
                    </button>
                    <button type="submit" class="btn btn-primary">
                        确认
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>